<template>
  <div class="header">    
    <!-- 返回 -->
    <div class="header-left"><div class="iconfont back-icon">&#xe624;</div></div>
    <!-- 内容 -->
    <div class="header-input"><span class="iconfont">&#xe632;</span>输入城市/景点/游玩主题</div>
    <!-- 城市 -->
    <router-link to="/city">

    <div class="header-right">{{city.city}}<span class="iconfont arrow-icon">&#xe62d;</span></div>

    </router-link>    
  </div>
</template>

<script>
  import {mapState} from "vuex";

  export default {
    name: "HomeHeader",
    computed: {
      ...mapState({city: "city"}),     
    }
  }
</script>

<style scoped> 
  .header {    
    display: flex; /* 开启弹性盒 */
    
    background-color: #00bcd4; /* 背景颜色 */

    line-height: 43px; /* 文字剧中高度 */
    /* line-height: 0.86rem; */
    color:#fff;
  }
  
  /* 左侧 */
  .header .header-left {    
    float: left;
   
    /* width: 0.64rem; */
    width: 32px;       
  }
  .header .header-left .back-icon {
    /* font-size: 0.4rem; */
    font-size: 20px;
    text-align: center;
  }

  /* 中部 */
  .header .header-input {    
    flex: 1; /* 等比排列 */

    height: 32px;
    background-color: #fff;
    
    padding-left: 10px;
    margin-top: 6px;
    margin-left: 10px;
    border-radius: 5px;

    color: #ccc;    
    line-height: 32px;        
  }

  /* 右侧 */
  .header .header-right {    
    float: right;

    /* width: 1.24rem; */
    min-width: 52px;
    padding: 0px 5px;

    text-align: center;
    color:#fff;
  }
  .header .header-right .arrow-icon {
    font-size: 12px;
    margin-left: 2px;
  }
</style>